package com.hz.ruoyiequipment.warning.service.impl;

import com.hz.ruoyiequipment.warning.service.SmsService;
import com.hz.ruoyiequipment.warning.util.SendSmsUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SmsServiceImpl implements SmsService {
    private final SendSmsUtil sendSmsUtil;

    @Autowired
    public SmsServiceImpl(SendSmsUtil sendSmsUtil) {
        this.sendSmsUtil = sendSmsUtil;
    }

    public String sendVerificationCode(String phoneNumber, String code) {
        String signName = "阿里云短信测试";
        String templateCode = "SMS_154950909";
        String templateParam = "{\"code\":\"" + code + "\"}";
        return sendSmsUtil.sendSms(signName, templateCode, phoneNumber, templateParam);
    }
}